<html> 
<script> 
var webcamimage; 
var imgBase="webcam.png?" 
var c = 0; 
function count() 
{ 
 webcamimage.src=imgBase+(++c); 
} 
function init() 
{ 
 webcamimage = document.getElementById("webcamimage"); 
 if( webcamimage ) 
 { 
  setInterval("count()",1000); 
 } 
} 
window.onload = init; 
</script> 
<body> 
<table width="1000" height="70" border="1">
  <tr>
    <td>Webcam Video</td>
    <td>Webcam Image</td>
    <td>Facial Recognition</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><img src="#*$!webcam.png" name="image" id="webcamimage"></td>
    <td>
	<?php

	$yourApiKey = '1bd8e0eb7a7e7afad7fab1a24878acfd';
	$yourApiSecret = 'dfab0ee61249724892383c1c54e4eae8';
	//load the client PHP library
	require_once(__DIR__ . "/FaceRestClient.php");
	//initialize API object with API key and Secret
	$api = new FaceRestClient($yourApiKey, $yourApiSecret);
	$urls = 'http://cse.unl.edu/~dstratma/webcam.png';
	//$urls = array_splice($urls, 0, 30);
	$tags = $api->faces_detect($urls);

	echo json_encode($tags);
	?>
	</td>
  </tr>
</table>
</body> 
</html> 
